/**
 * @Author: 宋计民
 * @Date: 2022/11/6
 * @Version: 1.0
 * @Content:
 */

interface Obj {
  [propName: string]: any
}

export function createEnumList(
  nameMap: Obj,
  valueMap: Obj,
  excludes: Array<any> = []
) {
  return Object.keys(valueMap)
    .map((key) => {
      if (excludes.includes(key)) {
        return
      }
      const _key = valueMap[key]
      return {
        name: nameMap[_key],
        value: _key
      }
    })
    .filter(Boolean)
}
